Skip to content

Use typescript.d.ts in APISample tests #51061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 4, 2022

Conversation

jakebailey
Copy link
Member

The way we pull in the types for typescript in these tests works by including typescriptServices.d.ts into the project, which declares a global namespace, which then is reexported as a faked typescript package.

This reexport is already what the current typescript.d.ts does, so use that instead. This will allow us to remove typescriptServices.d.ts in the future.

This has been pulled out of #51026 as it's a change that can be made without removing typescriptServices.

The way we pull in the types for typescript in these tests only works
when we include typescriptServices.d.ts into the project, which declares
a global namespace, which then is reexported as the typescript package.

This reexport is already what the current typescript.d.ts does, but now
that we don't have the namespace at all, we can't do this. Instead,
simulate the typescript package directly and point it at the correct
d.ts file.

This is a good chagne regardless of the module transform, and could be
cherry-picked back to main early.
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 4, 2022
@jakebailey jakebailey changed the title Fix APISample tests to not depend on the existence of the ts namespace Use typescript.d.ts in APISample tests Oct 4, 2022
@jakebailey jakebailey merged commit 8af9a93 into microsoft:main Oct 4, 2022
@jakebailey jakebailey deleted the api-test-cherry-pick branch October 4, 2022 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants